//
//  Location.m
//  Repair_iOS
//
//  Created by ZhangPeng on 2017/10/31.
//  Copyright © 2017年 张朋. All rights reserved.
//

#import "Location.h"

@implementation Location

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.coordinates = [NSMutableArray array];
    }
    return self;
}

+ (NSString *)calculatePointDistanceWithBeginLatitude:(CGFloat)beginLatitude beginLongitude:(CGFloat)beginLongitude endLatitude:(CGFloat)endLatitude endLongitude:(CGFloat)endLongitude{
    CLLocation *begin =[[CLLocation alloc] initWithLatitude:beginLatitude longitude:beginLongitude];
    CLLocation *end=[[CLLocation alloc] initWithLatitude:endLatitude longitude:endLongitude ];
    CLLocationDistance kilometers=[begin distanceFromLocation:end]/1000;
    return [NSString stringWithFormat:@"%.1fKM",kilometers];
}

@end
